//
//  StockNewsService.h
//  Stock
//
//  Created by blacksun on 11-6-24.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BaseService.h"
#import "MacroDefine.h"
#import "SQLiteInstanceManager.h"
#import "ReadStatus.h"
#import "StockNewsContent.h"
#import "StockNewsContent.h"

#define kStockNewsServiceQueryStockNews     @"queryStockNews"
#define kStockNewsServiceQueryReportContent @"queryReportContent"

#define kStockNewsSectionIdKey              @"sectionId"
#define kStockNewsSectionIndexKey           @"sectionIndex"

#define kStockNewsContentReportIdKey        @"reportId"

@interface StockNewsService : BaseService<ASIHTTPRequestDelegate> {
    
}


-(void)queryStockNewsWithUrl:(NSString *)url ifNotExistInDBWithSectionId:(NSString *)aSectionId andSectionIndex:(int)aSectionIndex;
-(void)queryReportContentWithReportId:(NSString*)reportId;

-(void)saveStockNewses:(NSArray *)stockNewes;
-(NSInteger)countBySectionId:(NSString *)sectionId andSectionIndex:(int)sectionIndex;
-(NSArray *)selectStockNewsBySectionId:(NSString *)sectionId andSectionIndex:(int)sectionIndex;
-(void)deleteStockNewsBySectionId:(NSString *)sectionId startSectionIndex:(int)start andEndSectionIndex:(int)end;
-(void)updateStockNews:(NSArray *)stockNews;


-(NSInteger)countStockNewsContentByReportId:(NSString *)reportId;
-(NSArray *)selectStockNewsContentByReportId:(NSString *)reportId;

@end
